package com.tjhzzx.hnceCore2024.enums;

import javax.baja.sys.BFrozenEnum;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;

/**
 * @author Luc
 * @date 2019-11-14 22:13
 */
public final class BSubSystemType extends BFrozenEnum {
    public static final int PAGE = 0;
    public static final int IMAGE = 1;
    public static final int TEXT = 2;
    public static final int FILE = 3;
    public static final int URL = 4;

    public static final BSubSystemType page = new BSubSystemType(0);
    public static final BSubSystemType image = new BSubSystemType(1);
    public static final BSubSystemType text = new BSubSystemType(2);
    public static final BSubSystemType file = new BSubSystemType(3);
    public static final BSubSystemType url = new BSubSystemType(4);

    public static final BSubSystemType DEFAULT = page;

    public BSubSystemType(int ordinal) {
        super(ordinal);
    }

    public static BSubSystemType make(int ordinal) {
        return (BSubSystemType) page.getRange().get(ordinal, false);
    }

    public static BSubSystemType make(String tag) {
        return (BSubSystemType) page.getRange().get(tag);
    }

    public static String expose() {
        return "{\"PAGE\":0, \"IMAGE\":1, \"TEXT\":2, \"FILE\":3, \"URL\":4}";
    }

    @Override
    public Type getType() {
        return TYPE;
    }

    public static final Type TYPE = Sys.loadType(BSubSystemType.class);
}
